package com.iqiyi.pps.epg.core.model.program;

/**
 * Created by karkarrotxu on 2016/12/1.
 */
public class VVChangeAssist {
    private boolean change = false;

    private String originalSign;

    private String originalPassportSign;

    public VVChangeAssist(ProgramData programData, String passportSign) {
        originalSign = accountSign(programData);
        originalPassportSign = passportSign;
    }

    public void checkAgain(ProgramData programData, String passportSign) {
        String newSign = accountSign(programData);
        change = !(originalSign + "|" + originalPassportSign).equals(newSign + "|" + passportSign);
    }

    public String accountSign(ProgramData programData) {
        String sign = programData.getPname() + "|" +
                programData.getStartPlayTime().getTime() + "|" +
                programData.getStopPlayTime().getTime() + "|" +
                programData.getHot() + "|" +
                programData.getTest() + "|" +
                programData.getChatEnable() + "|" +
                programData.getBossStatus() + "|" +
                programData.getRecommendRate() + "|" +
                programData.getChatRoomId() + "|" +
                programData.getSubscribe()+ "|" +programData.getCategory();
        return sign;
    }

    public boolean isChange() {
        return change;
    }
}
